import { createBrowserRouter, Navigate } from "react-router-dom";
import Index from "@/views/home/index";
import Home from "@/views/home/pages/home";
import Project from "@/views/home/pages/project";
import Investigation from "@/views/investigation/index";
import Data from "@/views/data/index";
import Analysis from "@/views/data/pages/analysis";
import Answer from "@/views/data/pages/answer";
import Question from "@/views/question/index";
import Preview from "@/views/question/preview";
import Success from "@/views/question/success";

const router = createBrowserRouter([
  {
    path: "/",
    element: <Navigate to="/home" />
  },
  {
    path: "/",
    element: <Index />,
    children: [
      {
        path: "/home",
        element: <Home />
      },
      {
        path: "/project",
        element: <Project />
      }
    ]
  },
  {
    path: "/investigation",
    element: <Investigation />
  },
  {
    path: "/data",
    element: <Navigate to="/data/analysis" />
  },
  {
    path: "/data",
    element: <Data />,
    children: [
      {
        path: "analysis",
        element: <Analysis />
      },
      {
        path: "answer",
        element: <Answer />
      }
    ]
  },
  {
    path: "/question",
    element: <Question />
  },
  {
    path: "/preview",
    element: <Preview />
  },
  {
    path: "/survey/success",
    element: <Success />
  }
]);

export default router;
